home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr23 / tlxtw204.zip / ERR90.SLT < prev    next >
Text File  |  1995-01-21  |  2KB  |  81 lines

  1. main()
  2. {
  3.     _scr_chk_key=0;
  4.     write_file_entry_name();
  5.     capture("*close*");
  6.     _scr_chk_key=1;
  7.     exittelix(90,0);
  8. }
  9.  
  10. fputsi( int integer, int fhandle )//write an integer to a file
  11. {
  12.     str buf[20];
  13.     itos(integer,buf);
  14.     inschrs("^M^J",buf,0,2);
  15.     fputs(buf,fhandle);
  16. }
  17. ///////////////////////////////////////////////////////////////////////////////
  18. write_file_entry_name()
  19. {
  20.     str fname[64],buf[80];
  21.     int f;
  22.  
  23.     if(!getenv("temp",fname)) {
  24.         soft_wind("^"Temp^" Environment variable not found!",30);
  25.         return 0;
  26.     }
  27.     append_backslash(fname);
  28.     strcat(fname,"Entrynam.txt");
  29.     //status_wind( fname, 20 );
  30.     if(filefind(fname,0,buf))
  31.         return 1;
  32.     if((f=fopen(fname,"w"))==0) {
  33.         fclearerr(f);
  34.         buf="Open Error ";
  35.         strcat(buf,fname);
  36.         soft_wind(buf,40);
  37.         return 0;
  38.     }
  39.     fputs(_entry_name   ,f);
  40.     fputsi(get_baud()   ,f);
  41.     fputsi(get_parity() ,f);
  42.     fputsi(get_datab()  ,f);
  43.     fputsi(get_stopb()  ,f);
  44.     fputs("^M^J_entry_name, baud, parity, data bits, stop bits,",f);
  45.     fputs("^M^Jcomm params used by (Tlxtwase) Tlxtw Twassist Exit Routine, If this is not",f);
  46.     fputs("^M^Jthe name of the bbs currently logged onto, delete this file and run Bbsname",f);
  47.     fputs("^M^J(Ctrl-B).",f);
  48.     fclose(f);
  49.     return 1;
  50. }
  51. //////////////////////////////////////////////////////////////////////////////
  52. //                         Soft Wind
  53. soft_wind(str message, int duration)
  54. {
  55.     int old_chk_key;
  56.     old_chk_key = _scr_chk_key;
  57.     _scr_chk_key = 0;
  58.     int l, h, x, y, key = 0, ts;
  59.     cursor_onoff(0);
  60.     x=getx(); y=gety();
  61.     l = strlen(message)/2;
  62.     h = vsavearea(37-l, 10, 43+l, 14);
  63.     box(37-l, 10, 43+l, 14, 3, 0, 5 );
  64.     pstraxy(message, 40-l  , 12, 11 );
  65.     ts = timer_start(duration);
  66.     while( !key && !time_up(ts)) key=inkey();
  67.     vrstrarea(h);
  68.     cursor_onoff(1);
  69.     gotoxy(x,y);
  70.     timer_free(ts);
  71.     _scr_chk_key = old_chk_key;
  72.     return key;
  73. }
  74. ///////////////////////////////////////////////////////////////////////////////
  75. append_backslash( str string )
  76. {
  77.     if(subchr(string,strlen(string)-1)!='\')strcat(string,"\");
  78.     return string;
  79. }
  80. /////////////////////////////////////////////////////////////////////////////
  81.